<template>
  <div class="right">
    <h2>Bottom组件</h2>
    {{receiveMsg}}
  </div>
</template>
<script>
// 1.引入eventBus
import bus from '../utils/eventBus'
export default {
  name: 'BottomDemo',
  data() {
    return {
      receiveMsg:""
    }
  },
  created() {
    bus.$on("shareData",val => {
      this.receiveMsg = val;
    })
  }
}
</script>

<style scoped>
.right {
  width: 600px;
  height: 300px;
  background: lightgreen;
}
</style>